package com.tts.dede;

import android.app.Activity;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;

public class MemoryActivity extends Activity implements OnTouchListener{
    /** Called when the activity is first created. */
	
	MemoryView memoryView;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        memoryView = new MemoryView(this);
        memoryView.setOnTouchListener(this);
        setContentView(memoryView);
    }

	@Override
	protected void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
		memoryView.pause();
	}
	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
		memoryView.resume();
	}

	public boolean onTouch(View v, MotionEvent event) {
		// TODO Auto-generated method stub
		if(event.getAction() == MotionEvent.ACTION_UP){
			memoryView.setTouched(true);
			memoryView.setX(event.getX());
			memoryView.setY(event.getY());
		}
		return true;
	}


    
}